package com.book.pay.facade;

import com.book.pay.strategy.context.PayContext;
import com.book.pay.strategy.factory.PayContextFacatory;
import com.book.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @param
 * @author OYZ
 * @version 1.0.4
 * @description: 门面角色
 * @date 2024/2/19 21:34
 */
@Component
public class PayFacade {

    @Autowired
    private PayContextFacatory facatory;


    public String pay(Order order,Integer payType){
        PayContext context = facatory.getContext(payType);
        return context.execute(order);
    }

}
